package com.aggressionlabs.test.handler;

import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by shirland on 11/29/14.
 */
public class HelloHandler extends AbstractHandler {
    @Override
    public void handle(String s, Request baseRequest, HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {

        resp.setContentType("text/html;charset=utf-8");
        resp.setStatus(HttpServletResponse.SC_OK);
        baseRequest.setHandled(true);
        resp.getWriter().println("<h1> Hello World </h1>");

    }
}
